package core

import (
	"encoding/json"
	"fmt"
	"os"
	"zinx_game/global/variable"
)

func InitConf() {
	fmt.Println("加载配置文件config.json")
	file, _ := os.Open("conf/config.json")
	defer file.Close()
	decoder := json.NewDecoder(file)
	config := variable.SysConfig{}
	err := decoder.Decode(&config)
	if err != nil {
		fmt.Println("Error:", err)
		panic("加载配置出错")
	}
	variable.Config = &config
}
